package com.neusoft.chenhanhua.d0915;

import java.awt.Graphics;

public abstract class Shape {
	protected int x1;
	protected int y1;
	protected int x2;
	protected int y2;
	 public Shape() {
		 
	 }
	public Shape(int x1, int y1, int x2, int y2) {
		super();
		this.x1 = x1;
		this.y1 = y1;
		this.x2 = x2;
		this.y2 = y2;
	}
	//不知道是什么图形所以先定义一个抽象方法
	public abstract void draw(Graphics g);
	public int getX1() {
		return x1;
	}
	public void setX1(int x1) {
		this.x1 = x1;
	}
	public int getY1() {
		return y1;
	}
	public void setY1(int y1) {
		this.y1 = y1;
	}
	public int getX2() {
		return x2;
	}
	public void setX2(int x2) {
		this.x2 = x2;
	}
	public int getY2() {
		return y2;
	}
	public void setY2(int y2) {
		this.y2 = y2;
	}
	@Override
	public String toString() {
		return "Shape [x1=" + x1 + ", y1=" + y1 + ", x2=" + x2 + ", y2=" + y2 + "]";
	}

	 
}
